import { ref } from "vue";
import api from "@/service/container"; //引入封装数字字典接口

/**
 * 获取字典数据
 */
export function getDict(data) {
  const res = ref({});
  return (() => {
    data.forEach((d) => {
      res.value[d] = [];
      api.getDictList({ dictType: d }).then((result) => {
        res.value[d] = result.map((p) => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.cssClass }));
      });
    });
    return res.value;
  })();
}
